const {
  Sequelize,
  Model
} = require('sequelize')
const {
  sequelize
} = require('../config/db');

// 定义模型
class disease extends Model {

}

disease.init({
  id: {
    type: Sequelize.INTEGER,
    primaryKey: true,
    autoIncrement: true
  },
  diseaseName: {
    type: Sequelize.STRING(16),
    allowNull: false,
    comment: '名称'
  },
  type: {
    type: Sequelize.STRING,
    allowNull: true,
    comment: '类型'
  },
  overview:{
    type: Sequelize.TEXT('long'),
    allowNull: true,
    comment: '概述'
  },
  etiology:{
    type: Sequelize.TEXT('long'),
    allowNull: true,
    comment: '病因'
  },
  symptoms:{
    type: Sequelize.TEXT('long'),
    allowNull: true,
    comment: '症状'
  },
  medicalTreatment:{
    type: Sequelize.TEXT('long'),
    allowNull: true,
    comment: '就医'
  },
  treatment:{
    type: Sequelize.TEXT('long'),
    allowNull: true,
    comment: '治疗'
  },
  prognosis:{
    type: Sequelize.TEXT('long'),
    allowNull: true,
    comment: '预后'
  },
  daily:{
    type: Sequelize.TEXT('long'),
    allowNull: true,
    comment: '日常'
  },
  other:{
    type: Sequelize.TEXT('long'),
    allowNull: true,
    comment: '其他'
  },
  pv:{
    type: Sequelize.INTEGER,
    allowNull: true,
    comment: '浏览量'
  },
}, {
  sequelize,
  modelName: 'disease',
  tableName: 'disease'
})

// disease.sync({
//   force: true
// })

module.exports = disease